﻿'========================================================================
'功能:庫別設定虛擬倉設定,存檔時會將資產的虛擬倉做修改
'作者:andy
'日期: 2011/5/26
'========================================================================
Imports System.Data
Partial Class WebForm_Mail_SendMail
    Inherits BasePage
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not IsPostBack Then
            hiUID.Value = ActualUID
            hiDBName.Value = dbName
            If ChkProgramRight("1") = False Then '查詢
                gvHouseType.Visible = False
                btnQuery.Visible = False
            End If
            If ChkProgramRight("2") = False Then '新增
                btnInsert.Visible = False
                plInsert.Visible = False
            End If
            If ChkProgramRight("3") = False Then '刪除
                gvHouseType.Columns(0).Visible = False

            End If
        End If

    End Sub
    

   



    Protected Sub btnQuery_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnQuery.Click
        gvHouseType.DataBind()
    End Sub

    Protected Sub btnSave_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSave.Click
        Dim htBBl As AssetManage.BBL.HouseTypeBBL = New AssetManage.BBL.HouseTypeBBL()
        If htBBl.HouseTypeIsExist(ddlStoreHouse.SelectedValue, hiDBName.Value) Then
            ShowMessageForAjax(btnSave, GetLocalResourceObject("HoueIDExist"))
            mpIns.Show()
            Exit Sub
        End If

        htBBl.InsertHouseType(ddlStoreHouse.SelectedValue, ddlHouseType.SelectedValue, hiUID.Value, hiDBName.Value)
        gvHouseType.DataBind()

    End Sub

   
End Class
